package app.netant.finishbook.fltxt;

import cn.lily.com.enviroment.Enviroment;
import app.netant.book.base.BaseDetail;
import app.netant.book.base.BaseEntity;
import app.netant.book.base.BasePage;
import app.netant.book.base.BaseRoot;

public class FltxtRoot extends BaseRoot {
	
	public FltxtRoot(){
		this.homeUrl = "http://www.fltxt.com/kehuan/";
		this.pageUrl = "http://www.fltxt.com/kehuan/index_";
		this.tableKey = "fltxt";
	}

	@Override
	public String buildUrl(int pageIdx) {
		if(pageIdx==1){
			return this.homeUrl;
		}
		return this.pageUrl + pageIdx+".html";
	}

	@Override
	public BasePage buildPage(String url) {
		return new FltxtPage(url);
	}

	@Override
	public BaseDetail buildDetail(String url) {
		return new FltxtDetail(url);
	}

	@Override
	public BaseEntity buildEntity() {
		return new FltxtEntity();
	}
	
	@Override
	public void afterEntity(BaseEntity entity) {
		
	}
	
	public static void main(String[] args) {
		
		Enviroment.createEnv();
		Enviroment.getEnv().getLogBean().beginLog();
		
		FltxtRoot root = new FltxtRoot();
		//root.analyse(2);
		//root.excepCycle();
	}


	
}
